import 'dart:convert';


UserInfoEntity UserInfoEntityFromJson(String str) => UserInfoEntity.fromJson(json.decode(str));

String UserInfoEntityToJson(UserInfoEntity data) => json.encode(data.toJson());

class UserInfoEntity {
	int? id;
	String? phone;
	String? fullName;
	String? no;
	String? idCardFront;
	String? idCardEnd;
	int? status;
	int? authStatus;
	int? mt5Login;
	String? mt5Balance;
	int? userTypeId;
	String? authNote;
	String? nikname;
	String? mailbox;
	String? headUrl;
	int? rechargeSuccessNum;
	int? isInquiry;
	int? isSfz;
	int? isBank;
	String? kefuUrl;

	UserInfoEntity({
		this.id,
		this.phone,
		this.fullName,
		this.no,
		this.idCardFront,
		this.idCardEnd,
		this.status,
		this.authStatus,
		this.mt5Login,
		this.mt5Balance,
		this.userTypeId,
		this.authNote,
		this.nikname,
		this.mailbox,
		this.headUrl,
		this.rechargeSuccessNum,
		this.isInquiry,
		this.isSfz,
		this.isBank,
		this.kefuUrl,
	});

	factory UserInfoEntity.fromJson(Map<String, dynamic> json) => UserInfoEntity(
		id: json["id"],
		phone: json["phone"],
		fullName: json["full_name"],
		no: json["no"],
		idCardFront: json["id_card_front"],
		idCardEnd: json["id_card_end"],
		status: json["status"],
		authStatus: json["auth_status"],
		mt5Login: json["mt5_login"],
		mt5Balance: json["mt5_balance"],
		userTypeId: json["user_type_id"],
		authNote: json["auth_note"],
		nikname: json["nikname"],
		mailbox: json["mailbox"],
		headUrl: json["head_url"],
		rechargeSuccessNum: json["recharge_success_num"],
		isInquiry: json["is_inquiry"],
		isSfz: json["is_sfz"],
		isBank: json["is_bank"],
		kefuUrl: json["kefu_url"],
	);

	Map<String, dynamic> toJson() => {
		"id": id,
		"phone": phone,
		"full_name": fullName,
		"no": no,
		"id_card_front": idCardFront,
		"id_card_end": idCardEnd,
		"status": status,
		"auth_status": authStatus,
		"mt5_login": mt5Login,
		"mt5_balance": mt5Balance,
		"user_type_id": userTypeId,
		"auth_note": authNote,
		"nikname": nikname,
		"mailbox": mailbox,
		"head_url": headUrl,
		"recharge_success_num": rechargeSuccessNum,
	};

	@override
	String toString() {
		return jsonEncode(this);
	}

	String authStatusStr(){
		if(authStatus==1){
			return "认证中";
		}else if(authStatus==2){
			return "已认证";
		}else{
			return "未认证";
		}
	}

	int getCurrentStep(){
		if((rechargeSuccessNum ??0)>0){
			//已激活
			return 4;
		}else if(isInquiry==1){
			//已填报告
			return 3;
		}else if(isBank==1){
			//已添加银行卡
			return 2;
		}else if(isSfz==1){
			//已认证
			return 1;
		}else{
			 return 0;
		}
	}
}